package wei.qiang.ye.rabbitmqdemo.producer;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class HelloSender {

    //AmqpTemplate是springboot 提供的默认实现
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(String queueName, String message){
        rabbitTemplate.convertAndSend(queueName,message);
    }
}

